using UnityEngine;

public class butShootFromCar : MonoBehaviour
{
	public bool sniperModeButton;

	private void OnPress(bool isDown)
	{
		if (!(GameController.instance.carScript == null) && GameController.instance.carScript.isAcitveContol)
		{
			CameraZoneEnabler.GetCameraZone().shootfromButton = isDown;
			if (isDown && sniperModeButton)
			{
				TPSCamera.instance.ToggleTankSniperMode();
			}
			else if (isDown)
			{
				GameController.instance.carScript.startShoot();
			}
			else
			{
				GameController.instance.carScript.cancelShoot();
			}
		}
	}
}
